/***************************************************************
 * @file           systick.c
 * @brief
 * @author         WKJay
 * @Version
 * @Date           2024-05-13
 ***************************************************************/
#include "gd32f3x0.h"

volatile static uint32_t delay;

void systick_config(void) {
    if (SysTick_Config(SystemCoreClock / 1000U)) {
        while (1);
    }
    NVIC_SetPriority(SysTick_IRQn, 0);
}

void delay_1ms(uint32_t count) {
    delay = count;
    while (0U != delay) {
    }
}

void delay_decrement(void) {
    if (0U != delay) {
        delay--;
    }
}
